﻿NexusDeck Companion for Windows
===============================

The companion is the small counterpart to the NexusDeck app on iPhone and iPad.
It runs on your PC and carries out what you tap in NexusDeck: pressing keys,
launching programs, changing the volume, showing values from the PC.

Requirements
- Windows 10 or 11
- iPhone or iPad with NexusDeck on the SAME Wi-Fi / network as the PC
- Internet access on the first start (Python and add-on packages are downloaded)


1. Extract
----------
1. Right-click the ZIP file › Properties.
   At the bottom under "Security", tick "Unblock" › OK.
   (Otherwise Windows warns about a file from the internet on every start.)
2. Right-click › "Extract All…" and pick a permanent place, e.g. "Documents".
   This creates the folder "NexusDeck Companion".
   Do not start it from inside the ZIP file and do not extract to "Program Files".


2. Start
--------
In the "NexusDeck Companion" folder, double-click "Start-Windows.bat".

- If Python is missing on the PC, the window asks:
  "Install Python 3.14 from python.org now?" › press Y.
  Python is installed for your user account only (no administrator rights).
- On the first start the companion downloads its add-on packages. This takes a
  few minutes; the black window shows the progress and closes afterwards.
- If Windows shows "Windows protected your PC":
  "More info" › "Run anyway".
- If Windows Firewall reports that "Python" was blocked:
  tick "Private networks" › "Allow access".
  Without this, your iPhone cannot connect.

The "NexusDeck Companion" window then opens with a QR code.
From the second start on it takes only a few seconds.


3. Connect NexusDeck
--------------------
In NexusDeck tap "Connection" and scan the QR code in the companion window.
Done – the app then shows ONLINE at the top.
Without a camera: pick the PC under "Found on Wi-Fi" and enter the pairing
token shown in the companion window.


Good to know
------------
- LIVE / TEST: at the top of the companion window. Only in LIVE does the
  companion really press keys; in TEST actions are only shown.
- Start with Windows: switch on "Start with the computer" in the companion
  window. The companion then starts invisibly every time you sign in.
- Icon at the bottom right in the notification area: "Open window", "Restart",
  "Quit". Closing the window quits the companion.
- Launching programs: NexusDeck may only open programs that you allow in the
  companion window under "Applications for NexusDeck".
- Everything stays on your network. Only devices with the pairing token can
  control the companion.


Installing a new version
------------------------
1. Quit the companion (icon at the bottom right › Quit).
2. Unblock the new ZIP file as above and extract it to the SAME place;
   choose "Replace the files in the destination".
3. Run Start-Windows.bat.
Pairing, program permissions and settings are kept.
If NexusDeck shows a yellow "OUTDATED" at the top, a newer companion is needed.


Problems?
---------
- The iPhone cannot find the PC: same Wi-Fi? Firewall access allowed for
  "Private networks"? In Windows the network should be set to "Private"
  (Settings › Network & internet).
- What happened during start-up is written to "companion.log" in the folder.
- Something went wrong during setup: delete the subfolder ".venv" and run
  Start-Windows.bat again.


Removing
--------
Switch off "Start with the computer" in the companion window, quit the
companion and delete the "NexusDeck Companion" folder. You can remove Python
itself under Settings › Apps if you no longer need it.


Optional: AI suggestions
------------------------
For "AI Studio" in NexusDeck the companion needs your own OpenAI key as the
environment variable OPENAI_API_KEY (Windows search: "Edit environment
variables for your account"). Restart the companion afterwards. OpenAI may
charge for this. Everything else works normally without a key.
